package com.wufeng.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wufeng.entity.Reply;
import com.wufeng.service.ReplyService;
import com.wufeng.mapper.ReplyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Hxh
 * @description 针对表【reply】的数据库操作Service实现
 * @createDate 2023-12-19 21:39:01
 */
@Service
public class ReplyServiceImpl extends ServiceImpl<ReplyMapper, Reply>
        implements ReplyService {

    @Autowired
    private ReplyMapper replyMapper;

    @Override
    public void incrementLikeCount(Integer replyid) {
        replyMapper.incrementLikeCount(replyid);
    }

    @Override
    public void decrementLikeCount(Integer replyid) {
        replyMapper.decrementLikeCount(replyid);
    }

    @Override
    public boolean deleteReplyByArticleId(Integer articleId) {

        int result = replyMapper.deleteById(articleId);

        return result > 0 ? true : false;
    }
}




